package com.example.xgakj.newterminal.adapter;


import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.example.xgakj.newterminal.R;


/**
 * @ClassName:AccountAdapter
 * @Description:
 * @author Administrator
 * @date 2015-8-8 下午5:27:04
 *
 */
public class Play2Adapter extends BaseAdapter {

	private Context context;
	private int[] datas;
	
	public Play2Adapter(Context c,int[] d)
	{
		this.context=c;
		this.datas=d;
	}
	
	@Override
	public int getCount() {
		return datas.length;
	}

	@Override
	public Object getItem(int position) {
		return datas[position];
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder=null;
		if(convertView==null)
		{
			holder=new ViewHolder();
			convertView=LayoutInflater.from(context).inflate(R.layout.play2_popupwindow_item, null);
			holder.account=(TextView) convertView.findViewById(R.id.account);
			convertView.setTag(holder);
		}
		else
		{
			holder=(ViewHolder) convertView.getTag();
		}
		holder.account.setText(String.valueOf(datas[position]));
		return convertView;
	}
	private class ViewHolder{
		TextView account;
	}

}
